
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>编译与测试网络部署 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="chap2.html" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    编译部署
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.2.1" data-path="chap1.html">
            
                <a href="chap1.html">
            
                    
                    编译与测试网络部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="chap2.html">
            
                <a href="chap2.html">
            
                    
                    网络生成配置说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="chap3.html">
            
                <a href="chap3.html">
            
                    
                    启动网络脚本配置剖析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    通道实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="chap4.html">
            
                <a href="chap4.html">
            
                    
                    创建加入通道
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="chap5.html">
            
                <a href="chap5.html">
            
                    
                    更新通道配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="chap6.html">
            
                <a href="chap6.html">
            
                    
                    动态添加组织
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    合约实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="chap7.html">
            
                <a href="chap7.html">
            
                    
                    安装发布智能合约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="chap8.html">
            
                <a href="chap8.html">
            
                    
                    升级智能合约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="chap9.html">
            
                <a href="chap9.html">
            
                    
                    智能合约设置背书策略
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="chap10.html">
            
                <a href="chap10.html">
            
                    
                    调试go智能合约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="chap11.html">
            
                <a href="chap11.html">
            
                    
                    外部构建启动合约
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    SDK实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="chap12.html">
            
                <a href="chap12.html">
            
                    
                    基于Java SDK实现合约交易
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >编译与测试网络部署</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="1&#x73AF;&#x5883;&#x51C6;&#x5907;">1.&#x73AF;&#x5883;&#x51C6;&#x5907;</h2>
<table>
<thead>
<tr>
<th>&#x7CFB;&#x7EDF;&#x5DE5;&#x5177;</th>
<th>&#x7248;&#x672C;</th>
<th>&#x5907;&#x6CE8;</th>
</tr>
</thead>
<tbody>
<tr>
<td>CentOS</td>
<td>7</td>
</tr>
<tr>
<td>Docker</td>
<td>18.09.4</td>
</tr>
<tr>
<td>Docker-compose</td>
<td>1.23.2</td>
<td>&#x53C2;&#x8003;&#xFF1A;<a href="https://blog.csdn.net/qq_28540443/article/details/104262822" target="_blank">CentOS7&#x5B89;&#x88C5;Docker-compose&#x63A8;&#x8350;&#x65B9;&#x6848;</a></td>
</tr>
<tr>
<td>GO</td>
<td>1.13.4</td>
<td>&#x53C2;&#x8003;&#xFF1A;<a href="https://blog.csdn.net/qq_28540443/article/details/104265094" target="_blank">CentOS7&#x5B89;&#x88C5;Go</a></td>
</tr>
</tbody>
</table>
<h2 id="2&#x4E0B;&#x8F7D;&#x6E90;&#x7801;">2.&#x4E0B;&#x8F7D;&#x6E90;&#x7801;</h2>
<p>1.&#x521B;&#x5EFA;go&#x5DE5;&#x4F5C;&#x76EE;&#x5F55;</p>
<pre><code class="lang-bash">mkdir go
mkdir go/src
mkdir go/pkg 
mkdir go/bin
<span class="hljs-built_in">export</span> GOPATH=xx/go
</code></pre>
<p>2.&#x521B;&#x5EFA;hyperledger&#x76EE;&#x5F55;</p>
<pre><code class="lang-bash">mkdir go/src/github.com/hyperledger
</code></pre>
<p>3.&#x4E0B;&#x8F7D;fabric release-2.0&#x6E90;&#x7801;</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> go/src/github.com/hyperledger
git <span class="hljs-built_in">clone</span> https://github.com/hyperledger/fabric.git
<span class="hljs-built_in">cd</span> fabric &amp;&amp; git checkout release-2.0
</code></pre>
<p>&#x5047;&#x5982;&#x89C9;&#x5F97;git clone&#x6162;&#x53EF;&#x53C2;&#x8003; <a href="https://blog.csdn.net/qq_28540443/article/details/104264141" target="_blank">&#x5982;&#x4F55;&#x5FEB;&#x901F;clone github&#x4EE3;&#x7801;&#x5E93;</a></p>
<h2 id="3-&#x7F16;&#x8BD1;&#x4E8C;&#x8FDB;&#x5236;&#x6587;&#x4EF6;&#x4EE5;&#x53CA;docker&#x955C;&#x50CF;">3. &#x7F16;&#x8BD1;&#x4E8C;&#x8FDB;&#x5236;&#x6587;&#x4EF6;&#x4EE5;&#x53CA;docker&#x955C;&#x50CF;</h2>
<p>&#x5F53;&#x524D;&#x5728;fabric&#x76EE;&#x5F55;
&#x6253;&#x5F00;&#x63A7;&#x5236;&#x53F0;&#x8FDB;&#x5165;fabric&#x76EE;&#x5F55;&#xFF0C;&#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;</p>
<pre><code class="lang-bash">make all
</code></pre>
<p>&#x4E2D;&#x95F4;&#x53EF;&#x80FD;&#x63D0;&#x793A;&#x6CA1;&#x6709;&#x5B89;&#x88C5;gcc&#xFF0C;&#x6B64;&#x65F6;&#x53EA;&#x9700;&#x8981;&#x5B89;&#x88C5;&#x5373;&#x53EF;</p>
<pre><code class="lang-bash">yum install gcc
</code></pre>
<p>&#x6267;&#x884C;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x67E5;&#x770B;&#x7F16;&#x8BD1;&#x4E8C;&#x8FDB;&#x5236;&#x6587;&#x4EF6;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-bash">ll build/bin
</code></pre>
<p>&#x63A7;&#x5236;&#x53F0;&#x8F93;&#x51FA;&#x5982;&#x4E0B;&#xFF1A;</p>
<p><img src="https://img-blog.csdnimg.cn/20200211171641259.png" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<p>&#x6267;&#x884C;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x67E5;&#x770B;&#x7F16;&#x8BD1;Docker&#x955C;&#x50CF;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-bash">docker images |grep 2.0|grep fabric
</code></pre>
<p>&#x63A7;&#x5236;&#x53F0;&#x8F93;&#x51FA;&#x5982;&#x4E0B;&#xFF1A;</p>
<p><img src="https://img-blog.csdnimg.cn/20200211171800905.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<h2 id="4&#x8FD0;&#x884C;&#x6D4B;&#x8BD5;&#x7F51;&#x7EDC;">4.&#x8FD0;&#x884C;&#x6D4B;&#x8BD5;&#x7F51;&#x7EDC;</h2>
<p>1.&#x5C06;&#x7F16;&#x8BD1;&#x5B8C;&#x6210;&#x7684;&#x4E8C;&#x8FDB;&#x5236;&#x6587;&#x4EF6;&#x590D;&#x5236;&#x5230; fabric-samples &#x76EE;&#x5F55;</p>
<pre><code class="lang-bash">cp -r build/bin fabric-samples
</code></pre>
<p>2.&#x7F51;&#x7EDC;&#x51C6;&#x5907;</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span>  fabric-samples/first-network 
./byfn.sh generate
</code></pre>
<p>&#x751F;&#x6210;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#x4EE5;&#x53CA;&#x901A;&#x9053;&#x6587;&#x4EF6;&#x5982;&#x4E0B;
<img src="https://img-blog.csdnimg.cn/2020021117292335.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<p>3.&#x8FD0;&#x884C;&#x6D4B;&#x8BD5;&#x7F51;&#x7EDC;</p>
<pre><code class="lang-bash">./byfn.sh up
</code></pre>
<p>&#x63A7;&#x5236;&#x53F0;&#x8F93;&#x51FA;&#x5982;&#x4E0B;&#x63D0;&#x793A;&#x5373;&#x8FD0;&#x884C;&#x6210;&#x529F;
<img src="https://img-blog.csdnimg.cn/20200211173055678.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<p>&#x67E5;&#x770B;docker&#x72B6;&#x6001;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-bash">docker ps |grep fabric
</code></pre>
<p>&#x6267;&#x884C;&#x7ED3;&#x679C;&#x5982;&#x4E0B;&#xFF1A;
<img src="https://img-blog.csdnimg.cn/20200211173206200.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<h2 id="5end">5.END</h2>
<p>&#x5B98;&#x65B9;&#x6D4B;&#x8BD5;&#x7F51;&#x7EDC;&#x8FD0;&#x884C;&#x7ED3;&#x675F;&#xFF0C;&#x63A5;&#x4E0B;&#x6765;&#x5C06;&#x5BF9;2.0&#x7684;&#x90E8;&#x7F72;&#x914D;&#x7F6E;&#x3001;&#x5408;&#x7EA6;&#x4EE5;&#x53CA;raft&#x5171;&#x8BC6;&#x8FDB;&#x884C;&#x7EE7;&#x7EED;&#x5B66;&#x4E60;&#xFF0C;&#x8BF7;&#x6301;&#x7EED;&#x5173;&#x6CE8;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="chap2.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 网络生成配置说明">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"编译与测试网络部署","level":"1.2.1","depth":2,"next":{"title":"网络生成配置说明","level":"1.2.2","depth":2,"path":"chap2.md","ref":"chap2.md","articles":[]},"previous":{"title":"编译部署","level":"1.2","depth":1,"ref":"","articles":[{"title":"编译与测试网络部署","level":"1.2.1","depth":2,"path":"chap1.md","ref":"chap1.md","articles":[]},{"title":"网络生成配置说明","level":"1.2.2","depth":2,"path":"chap2.md","ref":"chap2.md","articles":[]},{"title":"启动网络脚本配置剖析","level":"1.2.3","depth":2,"path":"chap3.md","ref":"chap3.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"chap1.md","mtime":"2020-03-12T03:45:17.051Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-12T04:26:38.647Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

